package AbstractFactoryModel;

/**
 * @program: DesignModeProject
 * @description:
 * @author: Li canzhang
 * @create: 2022-04-26 10:16
 **/
public class OrderPizza {
    private AbsFactory factory;

    public void setFactory(AbsFactory factory) {
        this.factory = factory;
    }

    public static void main(String[] args) {
        OrderPizza orderPizza = new OrderPizza();
        orderPizza.setFactory(new BJFactory());

        Pizza cheese = orderPizza.factory.createPizza("cheese");
        System.out.println(cheese);
    }
}
